#include "sdlMonitor.h"
#include "SDL/SDL.h"

unsigned sdlMonitor::counter = 0;
sdlMonitor* sdlMonitor::instancia = NULL;

sdlMonitor* sdlMonitor::getInstance(){
	if (instancia == NULL){
		instancia = new sdlMonitor;
	}
	counter++;
	return instancia;
}
void sdlMonitor::eliminar(){
	counter --;
	if (counter == 0 && instancia != NULL){
		delete instancia;
	}
}

sdlMonitor::sdlMonitor(){
	//Error if sdl_init == -1
	SDL_Init(SDL_INIT_EVERYTHING);
}

sdlMonitor::~sdlMonitor(){
	SDL_Quit();
}

sdlMonitor::sdlMonitor(const sdlMonitor&){}

void sdlMonitor::operator=(const sdlMonitor&){}
